<?php

@include_once("connect.php");

$res = [];
$tell = $_POST["tellnumber"];

$sql = "DELETE FROM user WHERE tellnumber='$tell'";
$a = mysqli_query($con, $sql);
$sql = "DELETE FROM user_cart WHERE tellnumber='$tell'";
$b = mysqli_query($con, $sql);
if ($tell) {
  if ($a > 0 && $b > 0) {
    $res["status"] = true;
    $res["mag"] = "账号已成功注销";
  } else {
    $res["status"] = false;
    $res["mag"] = "数据库错误";
  }
} else {
  $res["status"] = false;
  $res["mag"] = "前端数据错误";
}
echo (json_encode($res, JSON_UNESCAPED_UNICODE));
